package org.dreamfly.netshop.entity;

import java.util.Date;
import java.util.LinkedHashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * OrderInfo entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "Orderinfo")
public class OrderInfo implements java.io.Serializable {

    // Fields
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    @ManyToOne(targetEntity = Member.class, fetch = FetchType.LAZY)
    @JoinColumn(name = "MemberID")
    private Member member;
    @Column(name = "orderdate")
    private Date orderDate;
    @Column(name = "goodsfee")
    private Double goodsFee;
    @Column(name = "totalprice")
    private Double totalPrice;
    @Column(name = "shipfee")
    private Double shipFee;
    @Column(name = "shiptype")
    private Integer shipType;
    @Column(name = "paytype")
    private Integer payType;
    @Column(name = "receivername")
    private String receiverName;
    @Column(name = "receiverphone")
    private String receiverPhone;
    @Column(name = "isconfirm")
    private boolean isConfirm;
    @Column(name = "ispayment")
    private boolean isPayment;
    @Column(name = "isconsignment")
    private boolean isConsignment;
    @Column(name = "ispigeonhole")
    private boolean isPigeonhole;
    @Column(name = "receiverpostcode")
    private String receiverPostCode;
    @Column(name = "receiveraddress")
    private String receiverAddress;
    @Column(name = "receiveremails")
    private String receiverEmails;

    @ManyToOne(targetEntity = Address.class, fetch = FetchType.LAZY)
    @JoinColumn(name = "AddressID")
    private Address address;

    @OneToMany(targetEntity = BuyInfo.class, mappedBy = "orderInfo")
    private Set<BuyInfo> buyInfos = new LinkedHashSet<BuyInfo>(0);

    // Constructors

    /** default constructor */
    public OrderInfo() {
    }

    /** minimal constructor */
    public OrderInfo(Member member) {
        this.member = member;
    }

    // Property accessors

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    public Member getMember() {
        return this.member;
    }

    public void setMember(Member member) {
        this.member = member;
    }

    public Date getOrderDate() {
        return this.orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    public Double getGoodsFee() {
        return this.goodsFee;
    }

    public void setGoodsFee(Double goodsFee) {
        this.goodsFee = goodsFee;
    }

    public Double getTotalPrice() {
        return this.totalPrice;
    }

    public void setTotalPrice(Double totalPrice) {
        this.totalPrice = totalPrice;
    }

    public Double getShipFee() {
        return this.shipFee;
    }

    public void setShipFee(Double shipFee) {
        this.shipFee = shipFee;
    }

    public Integer getShipType() {
        return this.shipType;
    }

    public void setShipType(Integer shipType) {
        this.shipType = shipType;
    }

    public Integer getPayType() {
        return this.payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public String getReceiverName() {
        return this.receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    public String getReceiverPhone() {
        return this.receiverPhone;
    }

    public void setReceiverPhone(String receiverPhone) {
        this.receiverPhone = receiverPhone;
    }

    public boolean getIsConfirm() {
        return this.isConfirm;
    }

    public void setIsConfirm(boolean isConfirm) {
        this.isConfirm = isConfirm;
    }

    public boolean getIsPayment() {
        return this.isPayment;
    }

    public void setIsPayment(boolean isPayment) {
        this.isPayment = isPayment;
    }

    public boolean getIsConsignment() {
        return this.isConsignment;
    }

    public void setIsConsignment(boolean isConsignment) {
        this.isConsignment = isConsignment;
    }

    public boolean getIsPigeonhole() {
        return this.isPigeonhole;
    }

    public void setIsPigeonhole(boolean isPigeonhole) {
        this.isPigeonhole = isPigeonhole;
    }

    public String getReceiverPostCode() {
        return this.receiverPostCode;
    }

    public void setReceiverPostCode(String receiverPostCode) {
        this.receiverPostCode = receiverPostCode;
    }

    public String getReceiverAddress() {
        return this.receiverAddress;
    }

    public void setReceiverAddress(String receiverAddress) {
        this.receiverAddress = receiverAddress;
    }

    public String getReceiverEmails() {
        return this.receiverEmails;
    }

    public void setReceiverEmails(String receiverEmails) {
        this.receiverEmails = receiverEmails;
    }

    public Set<BuyInfo> getBuyInfos() {
        return this.buyInfos;
    }

    public void setBuyInfos(Set<BuyInfo> buyInfos) {
        this.buyInfos = buyInfos;
    }

}